#!/bin/bash

echo "开始卸载Nginx..."

# 停止服务
systemctl stop nginx 2>/dev/null || true
systemctl disable nginx 2>/dev/null || true

# 卸载Nginx
yum remove -y nginx

# 删除配置文件和数据
rm -rf /etc/nginx
rm -rf /var/log/nginx
rm -rf /usr/share/nginx
rm -rf /usr/local/nginx
rm -f /etc/yum.repos.d/nginx.repo

# 清理缓存
yum clean all

echo "Nginx卸载完成！"

